import pygame
import sys



class Point(object):
    def __init__(self, x, y, parent = None):
        self.x = x
        self.y = y
        self.cost = sys.maxsize
        self.parent = None
        self.color = (0,0,0)
    def draw(self,screen, G,color = (100,100,100)):
        l = G.unit - 2*G.line_width
        x = self.x * G.unit + G.line_width
        y = self.y * G.unit + G.line_width
        pygame.draw.rect(screen, color, (x, y, l, l), 0)

    def __eq__(self, p):
        return self.x == p.x and self.y == p.y
    def __str__(self):
        return 'position: (' + str(self.x) + ','+ str(self.y) + ')' + '\t '+'cost: '+ str(self.cost)+'\t' +'parent: '+str(self.parent)
        #return 'position: (' + str(self.x) + ',' + str(self.y) + ')' + ' parent: ' + str(self.parent)
